import java.awt.Dimension;
import java.awt.Point;
import java.awt.Polygon;


public class WorldToPanelCoordinates
{
	public WorldToPanelCoordinates(Dimension panelSize)
	{
		itsPanelsSize = new Dimension(panelSize);
	}
	
	public int worldToPanelX(int xPos)
	{
		return xPos;
	}
	
	public int worldToPanelY(int yPos)
	{
		return itsPanelsSize.height - yPos;
	}
	
	public void worldToPanel(Polygon p)
	{
		for(int i = 0; i < p.npoints; ++i)
		{
			p.ypoints[i] = worldToPanelY(p.ypoints[i]);
		}
	}
	
	public void worldToPanel(Point p)
	{
		p.y = worldToPanelY(p.y);
	}
	
	Dimension itsPanelsSize;
}
